//
//  WDRootFirstTableViewCell.m
//  qiJi
//
//  Created by 凤利史 on 2018/3/27.
//  Copyright © 2018年 sunrose. All rights reserved.
//

#import "WDRootFirstTableViewCell.h"

@implementation WDRootFirstTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    if (self = [super initWithStyle:style reuseIdentifier:@"identifier"]) {
        
        [self creationView];
    }
    return self;
}
- (void)creationView{
    
    UIImageView *imgView = [[UIImageView alloc] init];
    [self addSubview:imgView];
    [imgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self);
        make.left.equalTo(self);
        make.right.equalTo(self);
        make.height.offset(81);
        
    }];
    imgView.backgroundColor = [UIColor yellowColor];
    
    self.headImgView = [[UIImageView alloc] init];
    [self addSubview:self.headImgView];
    [self.headImgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self).with.offset(44);
        make.left.equalTo(self).with.offset(25);
        make.height.offset(75);
        make.width.offset(75);
        
    }];
    self.headImgView.backgroundColor = [UIColor blueColor];
    
    self.headButton = [[UIButton alloc] init];
    [self addSubview:self.headButton];
    [self.headButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self).with.offset(44);
        make.left.equalTo(self).with.offset(25);
        make.height.offset(75);
        make.width.offset(75);
        
    }];
    self.headButton.backgroundColor = [UIColor clearColor];
    
    
    self.dengJiImgView = [[UIImageView alloc] init];
    self.dengJiImgView.image = [UIImage imageNamed:@"my_badge_icon"];
    [self addSubview:self.dengJiImgView];
    [self.dengJiImgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.headImgView.mas_right).with.offset(10);
        make.top.equalTo(imgView.mas_bottom).with.offset(10);
//        make.height.offset(25);
//        make.width.offset(25);
        
        
    }];
    //self.dengJiImgView.backgroundColor = [UIColor orangeColor];
    
    self.dengLuBtn = [[UIButton alloc] init];
    
    [self addSubview:self.dengLuBtn];
    [self.dengLuBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.headImgView.mas_bottom).with.offset(15);
        make.centerX.equalTo(self.headImgView);
        make.height.offset(15);
        
        
    }];
    [self.dengLuBtn setTitle:@"请登录" forState:UIControlStateNormal];
    self.dengLuBtn.titleLabel.font =[UIFont fontWithName:@"DINEngschrift LT Alternate" size:15*CHANGE_SIZE];
    [self.dengLuBtn setTitleColor:getColor(@"333333") forState:UIControlStateNormal];
    self.jiFenLan = [[UILabel alloc] init];
    [self addSubview:self.jiFenLan];
    self.jiFenLan.text =@"222";
    [self.jiFenLan mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self).with.offset(-36);
        make.top.equalTo(imgView.mas_bottom).with.offset(30);
        make.height.offset(16);
        
    }];
    self.jiFenLan.font = [UIFont fontWithName:@"DINEngschrift LT Alternate" size:20*CHANGE_SIZE];
    self.jiFenLan.textColor = getColor(@"FED500");
    
    UIImageView *img = [[UIImageView alloc] init];
    [self addSubview:img];
    img.image = [UIImage imageNamed:@"my_more_icon"];
    [img mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.right.equalTo(self).with.offset(-25);
        make.top.equalTo(self.jiFenLan.mas_bottom).with.offset(12);
        
        
    }];
    self.woDeJiFenBtn = [[UIButton alloc] init];
    [self addSubview:self.woDeJiFenBtn];
    [self.woDeJiFenBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(img.mas_left).with.offset(-5);
        make.top.equalTo(self.jiFenLan.mas_bottom).with.offset(10);
        make.height.offset(12);
        
    }];
    [self.woDeJiFenBtn setTitle:@"我的积分" forState:UIControlStateNormal];
    [self.woDeJiFenBtn setTitleColor:getColor(@"333333") forState:UIControlStateNormal];
    self.woDeJiFenBtn.titleLabel.font = [UIFont systemFontOfSize:12];
    UIView *line = [[UIView alloc] init];
    [self addSubview:line];
    [line mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self);
        make.right.equalTo(self);
        make.top.equalTo(self.dengLuBtn.mas_bottom).with.offset(20);
        make.height.offset(1);
        
    }];
    line.backgroundColor = getColor(@"E6E6E6");
    ////////发布
    self.faBuButton = [[UIButton alloc] init];
   // self.faBuButton.backgroundColor = [UIColor redColor];
    [self addSubview:self.faBuButton];
    [self.faBuButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self);
        make.top.equalTo(line.mas_bottom);
        make.width.offset(DEF_SCREEN_WIDTH/4);
        make.height.offset(70);

    }];
    
    UILabel *labelFaBu = [[UILabel alloc] init];
    [self.faBuButton addSubview:labelFaBu];
    labelFaBu.text = @"发布";
    labelFaBu.font = [UIFont systemFontOfSize:14];
    labelFaBu.textColor = getColor(@"333333");
    [labelFaBu mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.faBuButton.mas_bottom).with.offset(-20);
        make.centerX.equalTo(self.faBuButton);
        make.height.offset(14);
 
    }];
    
    self.faBuLab = [[UILabel alloc] init];
    [self.faBuButton addSubview:self.faBuLab];
    self.faBuLab.text = @"111";
    self.faBuLab.font = [UIFont fontWithName:@"DINEngschrift LT Alternate" size:14*CHANGE_SIZE];
    self.faBuLab.textColor = getColor(@"333333");
    [self.faBuLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.faBuButton).with.offset(15);
        make.centerX.equalTo(self.faBuButton);
        make.height.offset(14);
        
    }];
    
    
    
    
    //关注
    self.guanZhuButton = [[UIButton alloc] init];
   // self.guanZhuButton.backgroundColor = [UIColor orangeColor];
    [self addSubview:self.guanZhuButton];
    [self.guanZhuButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.faBuButton.mas_right);
        make.top.equalTo(line.mas_bottom);
        make.width.offset(DEF_SCREEN_WIDTH/4);
        make.height.offset(70);
        
    }];
    
    UILabel *labelGuanZhu = [[UILabel alloc] init];
    [self.guanZhuButton addSubview:labelGuanZhu];
    labelGuanZhu.text = @"关注";
    labelGuanZhu.font = [UIFont systemFontOfSize:14];
    labelGuanZhu.textColor = getColor(@"333333");
    [labelGuanZhu mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.guanZhuButton.mas_bottom).with.offset(-20);
        make.centerX.equalTo(self.guanZhuButton);
        make.height.offset(14);
        
    }];
    
    self.guanZhuLab = [[UILabel alloc] init];
    [self.guanZhuButton addSubview:self.guanZhuLab];
    self.guanZhuLab.text = @"111";
    self.guanZhuLab.font = [UIFont fontWithName:@"DINEngschrift LT Alternate" size:14*CHANGE_SIZE];
    self.guanZhuLab.textColor = getColor(@"333333");
    [self.guanZhuLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.guanZhuButton).with.offset(15);
        make.centerX.equalTo(self.guanZhuButton);
        make.height.offset(14);
        
    }];
    
    
    
    
    //粉丝
    self.fenShiButton = [[UIButton alloc] init];
    //self.fenShiButton.backgroundColor = [UIColor blueColor];
    [self addSubview:self.fenShiButton];
    [self.fenShiButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.guanZhuButton.mas_right);
        make.top.equalTo(line.mas_bottom);
        make.width.offset(DEF_SCREEN_WIDTH/4);
        make.height.offset(70);
        
    }];
    
    UILabel *labelFenShi = [[UILabel alloc] init];
    [self.fenShiButton addSubview:labelFenShi];
    labelFenShi.text = @"粉丝";
    labelFenShi.font = [UIFont systemFontOfSize:14];
    labelFenShi.textColor = getColor(@"333333");
    [labelFenShi mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.fenShiButton.mas_bottom).with.offset(-20);
        make.centerX.equalTo(self.fenShiButton);
        make.height.offset(14);
        
    }];
    
    self.fenShiLab = [[UILabel alloc] init];
    [self.fenShiButton addSubview:self.fenShiLab];
    self.fenShiLab.text = @"111";
    self.fenShiLab.font = [UIFont fontWithName:@"DINEngschrift LT Alternate" size:14*CHANGE_SIZE];
    self.fenShiLab.textColor = getColor(@"333333");
    [self.fenShiLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.fenShiButton).with.offset(15);
        make.centerX.equalTo(self.fenShiButton);
        make.height.offset(14);
        
    }];
    
    
    
    
    //装备
    self.zhuangBeiButton = [[UIButton alloc] init];
   // self.zhuangBeiButton.backgroundColor = [UIColor yellowColor];
    [self addSubview:self.zhuangBeiButton];
    [self.zhuangBeiButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.fenShiButton.mas_right);
        make.top.equalTo(line.mas_bottom);
        make.width.offset(DEF_SCREEN_WIDTH/4);
        make.height.offset(70);
        
    }];
    
    UILabel *labelZhuangBei = [[UILabel alloc] init];
    [self.zhuangBeiButton addSubview:labelZhuangBei];
    labelZhuangBei.text = @"装备";
    labelZhuangBei.font = [UIFont systemFontOfSize:14];
    labelZhuangBei.textColor = getColor(@"333333");
    [labelZhuangBei mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.zhuangBeiButton.mas_bottom).with.offset(-20);
        make.centerX.equalTo(self.zhuangBeiButton);
        make.height.offset(14);
        
    }];
    
    self.zhuangBeiLab = [[UILabel alloc] init];
    [self.zhuangBeiButton addSubview:self.zhuangBeiLab];
    self.zhuangBeiLab.text = @"111";
    self.zhuangBeiLab.font = [UIFont fontWithName:@"DINEngschrift LT Alternate" size:14*CHANGE_SIZE];
    self.zhuangBeiLab.textColor = getColor(@"333333");
    [self.zhuangBeiLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.zhuangBeiButton).with.offset(15);
        make.centerX.equalTo(self.zhuangBeiButton);
        make.height.offset(14);
        
    }];
    
    
    
    
    
    
    
    
    
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
